﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Alos.Entity;
using Alos.Common;
using Alos.IRepository;
using Alos.IService;
using PetaPoco;

namespace Alos.Service
{
    public class GroupInfoService : BaseService<GroupInfo>, IGroupInfoService
    {
        IGroupInfoRepository GroupInfoRepository;
        public GroupInfoService(IGroupInfoRepository _GroupInfoRepository)
        {
            GroupInfoRepository = _GroupInfoRepository;
        }
        /// <summary>
        /// 根据教师ID和班级ID获取分组信息
        /// </summary>
        /// <param name="TeacherId">教师ID</param>
        /// <param name="ClassId">班级ID</param>
        /// <returns></returns>
      public  IEnumerable<dynamic> GetGroupInfo(int TeacherId, int ClassId)
        {
            return GroupInfoRepository.GetGroupInfo(TeacherId,ClassId);
        }
        /// <summary>
        /// 根据分组信息添加
        /// </summary>
        /// <param name="GroupInfo">分组信息</param>
        /// <returns></returns>
      public bool CreatGroupInfo(GroupInfo GroupInfo)
      {
          return GroupInfoRepository.CreatGroupInfo(GroupInfo);
      }
      /// <summary>
      /// 根据分组ID删除
      /// </summary>
      /// <param name="id">分组ID</param>
      /// <returns></returns>
      public bool DeleteGroupInfo(int id)
      {
          return GroupInfoRepository.DeleteGroupInfo(id);
      }
      /// <summary>
      /// 根据分组老师ID和班级ID删除
      /// </summary>
      /// <param name="TeacherId">老师ID</param>
      /// <param name="ClassId">班级ID</param>
      /// <returns></returns>
      public bool DeleteGroupInfoByTeachaerID(int TeacherId, int ClassId)
      {
          return GroupInfoRepository.DeleteGroupInfoByTeachaerID(TeacherId,ClassId);
      }
      /// <summary>
      /// 根据分组ID修改该组信息
      /// </summary>
      /// <param name="GroupInfo">分组信息</param>
      /// <returns></returns>
      public bool UpdateGroupInfo(GroupInfo GroupInfo)
      {
          return GroupInfoRepository.UpdateGroupInfo(GroupInfo);
      }
    }
}
